package com.liu.controller;

import com.liu.bean.ResultBean;

public class BaseController {
    final int SUCCESS = 200;
    final int FAIL = 0;


    protected ResultBean success(String msg) {
        return process(SUCCESS, msg, null);
    }

    protected <T> ResultBean success(String msg, T data) {
        return process(SUCCESS, msg, data);
    }

    protected <T> ResultBean fail(String msg) {
        return process(FAIL, msg, null);
    }

    ResultBean process(int code, String msg, Object data) {
        return new ResultBean(code, msg, data);
    }


}
